package no.ffi.gismoidm.attrex;

import java.util.Properties;

/**
 *
 * @author anders
 */
public class Or extends BooleanOperator {

    protected BooleanOperand op1,op2;
    public Or(BooleanOperand op1, BooleanOperand op2) { 
        super();
        this.op1 = op1;
        this.op2 = op2;
    }
    @Override
    public BooleanValue getBooleanValue(Properties attributes) throws AttributeEvaluationException {
        if (op1.getBooleanValue(attributes).truthValue()) return new BooleanValue(true);
        else return op2.getBooleanValue(attributes);
    }
    
    @Override
    public String toString() {
        return "or(" + op1.toString() + "," + op2.toString() + ")";
    }

}
